#!/usr/bin/python3
# -*- coding:utf-8 -*-
"""
@author: KevinQi
@file: factory.py
@time: 2023/12/26 15:20
@desc: 
"""
from backend.workjob.utils.mysql_base import MysqlSqlalchemy, MysqlBase, SqlAlBase
from sqlalchemy import Column, Integer, String, DateTime, Boolean, Float
from backend.workjob.utils.model_utils import ModelBase

from backend.conf import config


class Factory(ModelBase, SqlAlBase.base):
    __tablename__ = config.table_prefix + 'system_factory'
    factory_name = Column(String(30), nullable=False)
    license_id = Column(String(30), nullable=False, unique=True)
    factory_id = Column(String(30), nullable=False, unique=True)
    phone = Column(String(30), nullable=False, unique=True, comment="用户登陆手机号")


def select():
    session = MysqlSqlalchemy().session
    result = session.query(Factory).filter().all()
    print(result)
    for i in result:
        print(i.id)

